{"ast":null,"code":"import { makeAutoObservable } from \"mobx\";\nimport { UserService, AuthService, ChatService } from \"../services/\";\nimport axios from \"axios\";\nimport { refreshToken } from \"../routes\";\nimport ContentService from \"../services/ContentService\";\nimport ContactService from \"../services/ContactService\";\nexport default class Store {\n  constructor() {\n    this.isAuth = false;\n    this.profile = {};\n    this.chats = {};\n    this.currentDialog = {};\n    this.viewedDialogId = null;\n    this.contacts = {};\n    this.isLoading = false;\n    this.isError = false;\n    this.getAuth = () => {\n      return this.isAuth;\n    };\n    this.getLoading = () => {\n      return this.isLoading;\n    };\n    this.logout = () => {\n      this.removeTokensTolLocalStorage();\n      this.setAuth(false);\n      this.setProfile({});\n    };\n    makeAutoObservable(this);\n  }\n  setAuth(bool) {\n    this.isAuth = bool;\n  }\n  getProfile() {\n    return this.profile;\n  }\n  setProfile(profile) {\n    this.profile = profile;\n  }\n  getChats() {\n    return this.chats;\n  }\n  setChats(chats) {\n    this.chats = chats;\n  }\n  getCurrentDialog() {\n    return this.currentDialog;\n  }\n  setCurrentDialog(currentDialog) {\n    this.currentDialog = currentDialog;\n  }\n  getViewedDialogId() {\n    return this.viewedDialogId;\n  }\n  setViewedDialogId(viewedDialogId) {\n    this.viewedDialogId = viewedDialogId;\n  }\n  getContacts() {\n    return this.contacts;\n  }\n  setContacts(contacts) {\n    this.contacts = contacts;\n  }\n  setLoading(bool) {\n    this.isLoading = bool;\n  }\n  setIsError(bool) {\n    this.isError = bool;\n  }\n  getIsError() {\n    return this.isError;\n  }\n  setTokensTolLocalStorage(response) {\n    localStorage.setItem(`${process.env.REACT_APP_NAME_TOKEN}`, response.data.token);\n    localStorage.setItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`, response.data.refresh_token);\n  }\n  removeTokensTolLocalStorage() {\n    localStorage.removeItem(`${process.env.REACT_APP_NAME_TOKEN}`);\n    localStorage.removeItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`);\n  }\n  async getProfileFromAPI() {\n    try {\n      const response = await UserService.profile();\n      this.setProfile(response.data);\n    } catch (e) {\n      this.removeTokensTolLocalStorage();\n    }\n  }\n  async signIn(request) {\n    try {\n      const response = await AuthService.signIn(request);\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.setIsError(true);\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async signUp(request) {\n    try {\n      const response = await AuthService.signUp(request);\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.setIsError(true);\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async forgotPassword(request) {\n    try {\n      await AuthService.forgotPassword(request);\n    } catch (e) {\n      this.setIsError(true);\n    }\n  }\n  async checkAuth() {\n    this.setLoading(true);\n    try {\n      const response = await axios.post(refreshToken(), {\n        \"refresh_token\": localStorage.getItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`)\n      });\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.removeTokensTolLocalStorage();\n      this.setIsError(true);\n    } finally {\n      this.setLoading(false);\n    }\n  }\n  async getChatsFromAPI() {\n    try {\n      return await ChatService.getChatsList().then(res => this.setChats(res.data));\n    } catch (e) {\n      var _e$response, _e$response$data;\n      if ((_e$response = e.response) !== null && _e$response !== void 0 && (_e$response$data = _e$response.data) !== null && _e$response$data !== void 0 && _e$response$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteProfileFromAPI() {\n    try {\n      this.setLoading(true);\n      await UserService.deleteProfile().then(res => {\n        if (res.data.request_status) {\n          this.logout();\n        }\n      });\n    } catch (e) {\n      var _e$response2, _e$response2$data;\n      if ((_e$response2 = e.response) !== null && _e$response2 !== void 0 && (_e$response2$data = _e$response2.data) !== null && _e$response2$data !== void 0 && _e$response2$data.message) {\n        console.error(e.response.data.message);\n      }\n    } finally {\n      this.setLoading(false);\n    }\n  }\n  async updateProfileFromAPI(profileRequest) {\n    try {\n      await UserService.updateProfile(profileRequest).then(res => {\n        if (res.status === 200) {\n          this.setProfile({\n            ...this.getProfile(),\n            ...res.data\n          });\n          this.setIsError(false);\n        }\n      });\n    } catch (e) {\n      var _e$response3, _e$response3$data;\n      if ((_e$response3 = e.response) !== null && _e$response3 !== void 0 && (_e$response3$data = _e$response3.data) !== null && _e$response3$data !== void 0 && _e$response3$data.message) {\n        this.setIsError(true);\n        console.error(e.response.data.message);\n      }\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async uploadAvatar(file) {\n    try {\n      const formData = new FormData();\n      formData.append('avatar', file);\n      await UserService.uploadAvatar(formData).then(res => {\n        if (res.status === 200) {\n          var _this$getProfile$cont;\n          const profileContents = {\n            items: ((_this$getProfile$cont = this.getProfile().content) === null || _this$getProfile$cont === void 0 ? void 0 : _this$getProfile$cont.items.slice()) || []\n          };\n\n          // @ts-ignore\n          profileContents.items.push(res.data);\n          this.setProfile({\n            ...this.getProfile(),\n            content: profileContents\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response4, _e$response4$data;\n      if ((_e$response4 = e.response) !== null && _e$response4 !== void 0 && (_e$response4$data = _e$response4.data) !== null && _e$response4$data !== void 0 && _e$response4$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteUserAvatarFromAPI(data, index) {\n    try {\n      await ContentService.deleteContent(data).then(res => {\n        var _this$getProfile$cont2;\n        if (res.status === 200 && data.id && data.avatar && (_this$getProfile$cont2 = this.getProfile().content) !== null && _this$getProfile$cont2 !== void 0 && _this$getProfile$cont2.items) {\n          var _this$getProfile$cont3;\n          const profileContents = {\n            items: ((_this$getProfile$cont3 = this.getProfile().content) === null || _this$getProfile$cont3 === void 0 ? void 0 : _this$getProfile$cont3.items.slice()) || []\n          };\n          profileContents.items.splice(index, 1);\n          this.setProfile({\n            ...this.getProfile(),\n            content: profileContents\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response5, _e$response5$data;\n      if ((_e$response5 = e.response) !== null && _e$response5 !== void 0 && (_e$response5$data = _e$response5.data) !== null && _e$response5$data !== void 0 && _e$response5$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteChatAvatarFromAPI(data, index, chatsListItem) {\n    try {\n      await ContentService.deleteContent(data).then(res => {\n        if (res.status === 200 && data.id && data.avatar) {\n          const chats = {\n            items: this.getChats().items.slice() || []\n          };\n          chats.items.forEach((chat, indexChat) => {\n            if (chatsListItem.id === chat.id) {\n              var _chats$items$indexCha;\n              (_chats$items$indexCha = chats.items[indexChat].content) === null || _chats$items$indexCha === void 0 ? void 0 : _chats$items$indexCha.items.splice(index, 1);\n            }\n          });\n          this.setChats({\n            ...this.getChats(),\n            items: chats.items\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response6, _e$response6$data;\n      if ((_e$response6 = e.response) !== null && _e$response6 !== void 0 && (_e$response6$data = _e$response6.data) !== null && _e$response6$data !== void 0 && _e$response6$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async getContactsFromAPI() {\n    try {\n      await ContactService.getContacts().then(res => {\n        if (res.status === 200) {\n          this.setContacts({\n            ...this.getContacts(),\n            ...res.data\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response7, _e$response7$data;\n      if ((_e$response7 = e.response) !== null && _e$response7 !== void 0 && (_e$response7$data = _e$response7.data) !== null && _e$response7$data !== void 0 && _e$response7$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n}","map":{"version":3,"names":["makeAutoObservable","UserService","AuthService","ChatService","axios","refreshToken","ContentService","ContactService","Store","constructor","isAuth","profile","chats","currentDialog","viewedDialogId","contacts","isLoading","isError","getAuth","getLoading","logout","removeTokensTolLocalStorage","setAuth","setProfile","bool","getProfile","getChats","setChats","getCurrentDialog","setCurrentDialog","getViewedDialogId","setViewedDialogId","getContacts","setContacts","setLoading","setIsError","getIsError","setTokensTolLocalStorage","response","localStorage","setItem","process","env","REACT_APP_NAME_TOKEN","data","token","REACT_APP_NAME_REFRESH_TOKEN","refresh_token","removeItem","getProfileFromAPI","e","signIn","request","setTimeout","signUp","forgotPassword","checkAuth","post","getItem","getChatsFromAPI","getChatsList","then","res","message","console","error","deleteProfileFromAPI","deleteProfile","request_status","updateProfileFromAPI","profileRequest","updateProfile","status","uploadAvatar","file","formData","FormData","append","profileContents","items","content","slice","push","deleteUserAvatarFromAPI","index","deleteContent","id","avatar","splice","deleteChatAvatarFromAPI","chatsListItem","forEach","chat","indexChat","getContactsFromAPI"],"sources":["/data/messenger.client/src/store/store.ts"],"sourcesContent":["import {makeAutoObservable} from \"mobx\";\nimport SignInRequest from \"../models/request/SignInRequest\";\nimport SignUpRequest from \"../models/request/SignUpRequest\";\nimport {UserService, AuthService, ChatService} from \"../services/\";\nimport {UserListItem} from \"../models/response/UserListItem\";\nimport axios, {AxiosResponse} from \"axios\";\nimport {AuthResponse} from \"../models/response/AuthResponse\";\nimport {refreshToken} from \"../routes\";\nimport ForgotPasswordRequest from \"../models/request/ForgotPasswordRequest\";\nimport {ChatsListResponse} from \"../models/response/ChatsListResponse\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\nimport ProfileRequest from \"../models/request/ProfileRequest\";\nimport {ContentListItem} from \"../models/response/ContentListItem\";\nimport ContentService from \"../services/ContentService\";\nimport {ContentListResponse} from \"../models/response/ContentListResponse\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\nimport ContactService from \"../services/ContactService\";\n\nexport default class Store {\n    private isAuth: boolean = false;\n    public profile = {} as UserListItem;\n    public chats = {} as ChatsListResponse;\n    public currentDialog = {} as ChatsListItem;\n    public viewedDialogId: number | null = null;\n    public contacts = {} as ContactListResponse;\n    private isLoading: boolean = false;\n    private isError: boolean = false;\n\n    public constructor() {\n        makeAutoObservable(this);\n    }\n\n    private setAuth(bool: boolean): void {\n        this.isAuth = bool;\n    }\n\n    public getAuth: () => boolean = () => {\n        return this.isAuth;\n    }\n\n    public getProfile(): UserListItem {\n        return this.profile;\n    }\n\n    public setProfile(profile: UserListItem): void {\n        this.profile = profile;\n    }\n\n    public getChats(): ChatsListResponse {\n        return this.chats;\n    }\n\n    private setChats(chats: ChatsListResponse): void {\n        this.chats = chats;\n    }\n\n    public getCurrentDialog(): ChatsListItem {\n        return this.currentDialog;\n    }\n\n    public setCurrentDialog(currentDialog: ChatsListItem): void {\n        this.currentDialog = currentDialog;\n    }\n\n    public getViewedDialogId(): number | null {\n        return this.viewedDialogId;\n    }\n\n    public setViewedDialogId(viewedDialogId: number | null): void {\n        this.viewedDialogId = viewedDialogId;\n    }\n\n    public getContacts(): ContactListResponse {\n        return this.contacts;\n    }\n\n    public setContacts(contacts: ContactListResponse): void {\n        this.contacts = contacts;\n    }\n\n    private setLoading(bool: boolean): void {\n        this.isLoading = bool;\n    }\n\n    public getLoading: () => boolean = () => {\n        return this.isLoading;\n    }\n\n    public setIsError(bool: boolean): void {\n        this.isError = bool;\n    }\n\n    public getIsError(): boolean {\n        return this.isError;\n    }\n\n    public setTokensTolLocalStorage(response: AxiosResponse<AuthResponse>): void {\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_TOKEN}`,\n            response.data.token\n        );\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_REFRESH_TOKEN}`,\n            response.data.refresh_token\n        );\n    }\n\n    public removeTokensTolLocalStorage(): void {\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_TOKEN}`);\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`);\n    }\n\n    private async getProfileFromAPI() {\n        try {\n            const response = await UserService.profile();\n            this.setProfile(response.data);\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n        }\n    }\n\n    public async signIn(request: SignInRequest) {\n        try {\n            const response = await AuthService.signIn(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async signUp(request: SignUpRequest) {\n        try {\n            const response = await AuthService.signUp(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async forgotPassword(request: ForgotPasswordRequest) {\n        try {\n            await AuthService.forgotPassword(request);\n        } catch (e) {\n            this.setIsError(true);\n        }\n    }\n\n     public logout = (): void => {\n        this.removeTokensTolLocalStorage();\n        this.setAuth(false);\n        this.setProfile({} as UserListItem);\n    }\n\n    public async checkAuth() {\n        this.setLoading(true);\n        try {\n            const response = await axios.post<AuthResponse>(\n                refreshToken(),\n                {\n                    \"refresh_token\": localStorage.getItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`)\n                }\n            );\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n            this.setIsError(true);\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async getChatsFromAPI() {\n        try {\n            return await ChatService.getChatsList().then((res: any) => (\n                this.setChats(res.data)\n            ));\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteProfileFromAPI() {\n        try {\n            this.setLoading(true);\n            await UserService.deleteProfile().then((res: any) => {\n                if (res.data.request_status!) {\n                    this.logout();\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async updateProfileFromAPI(profileRequest: ProfileRequest) {\n        try {\n            await UserService.updateProfile(profileRequest).then((res: any) => {\n                if (res.status === 200) {\n                    this.setProfile({\n                        ...this.getProfile(),\n                        ...res.data\n                    });\n                    this.setIsError(false);\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                this.setIsError(true);\n                console.error(e.response.data.message);\n            }\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async uploadAvatar(file: File) {\n        try {\n            const formData: FormData = new FormData();\n            formData.append('avatar', file);\n\n            await UserService.uploadAvatar(formData).then((res) => {\n                if (res.status === 200) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    // @ts-ignore\n                    profileContents.items.push(res.data);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteUserAvatarFromAPI(data: ContentListItem, index: number) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (\n                    res.status === 200 &&\n                    data.id &&\n                    data.avatar &&\n                    this.getProfile().content?.items\n                ) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    profileContents.items.splice(index, 1);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteChatAvatarFromAPI(data: ContentListItem, index: number, chatsListItem: ChatsListItem) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (res.status === 200 && data.id && data.avatar) {\n                    const chats: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n\n                    chats.items.forEach((chat, indexChat) => {\n                        if (chatsListItem.id === chat.id) {\n                            chats.items[indexChat].content?.items.splice(index, 1);\n                        }\n                    });\n\n                    this.setChats({\n                        ...this.getChats(),\n                        items: chats.items\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getContactsFromAPI() {\n        try {\n            await ContactService.getContacts().then((res: any) => {\n                if (res.status === 200) {\n                    this.setContacts({\n                        ...this.getContacts(),\n                        ...res.data\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n}"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,MAAM;AAGvC,SAAQC,WAAW,EAAEC,WAAW,EAAEC,WAAW,QAAO,cAAc;AAElE,OAAOC,KAAK,MAAuB,OAAO;AAE1C,SAAQC,YAAY,QAAO,WAAW;AAMtC,OAAOC,cAAc,MAAM,4BAA4B;AAGvD,OAAOC,cAAc,MAAM,4BAA4B;AAEvD,eAAe,MAAMC,KAAK,CAAC;EAUhBC,WAAW,GAAG;IAAA,KATbC,MAAM,GAAY,KAAK;IAAA,KACxBC,OAAO,GAAG,CAAC,CAAC;IAAA,KACZC,KAAK,GAAG,CAAC,CAAC;IAAA,KACVC,aAAa,GAAG,CAAC,CAAC;IAAA,KAClBC,cAAc,GAAkB,IAAI;IAAA,KACpCC,QAAQ,GAAG,CAAC,CAAC;IAAA,KACZC,SAAS,GAAY,KAAK;IAAA,KAC1BC,OAAO,GAAY,KAAK;IAAA,KAUzBC,OAAO,GAAkB,MAAM;MAClC,OAAO,IAAI,CAACR,MAAM;IACtB,CAAC;IAAA,KA8CMS,UAAU,GAAkB,MAAM;MACrC,OAAO,IAAI,CAACH,SAAS;IACzB,CAAC;IAAA,KAyEOI,MAAM,GAAG,MAAY;MACzB,IAAI,CAACC,2BAA2B,EAAE;MAClC,IAAI,CAACC,OAAO,CAAC,KAAK,CAAC;MACnB,IAAI,CAACC,UAAU,CAAC,CAAC,CAAC,CAAiB;IACvC,CAAC;IAtIGvB,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEQsB,OAAO,CAACE,IAAa,EAAQ;IACjC,IAAI,CAACd,MAAM,GAAGc,IAAI;EACtB;EAM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